import cv2

"""
图片取反值，将黑底白字转为白底黑字
"""

# img_name = "cut"
# img_name = "cut_1112101839-005"
# img_name = "cut_1112101839-007"
img_name = "cut_1112101839-027"
img_suffix = ".jpg"
# threshold = 200
# threshold = 230
# threshold = 235
threshold = 237
# threshold = 240
file_path = "../pic/pillow/"

img_path = file_path + img_name + "_convert_" + str(threshold) + img_suffix
src = cv2.imread(img_path, 1)
# print(src.shape)
Img = 255 - src
# print(Img.shape)
cv2.imwrite(file_path + img_name + "_inverse_" + str(threshold) + img_suffix, Img)


# cv2.imshow("Img", Img)
# cv2.imshow("src", src)
# cv2.waitKey(0)
